<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@taglib prefix="z" uri="http://www.liuhuazhi.com/diancan"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>  
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>订单管理</title>
<link rel="stylesheet" href="../css/dingdan/DingDanManager.css" />
</head>
<body>
	<input type="hidden" id="total" value="${map.total}">
	<div style="text-align: center">
		<h4>订单管理</h4>
	</div>
	<div class="head_item">
		<div class="header">
			<div class="cai">搜索订单ID：</div>
			<div class="input_find">
				<form action="../dingdan/dingdanManager" id="dingdanForm" name="search">
					<tr>
						<td><input
							type="text" name="dingdanId" title="Search" class="searchinput"
							id="searchinput"/></td>
						<td><input type="image" width="21" height="17"
							class="searchaction" alt="Search" src="../image/magglass.gif"
							border="0" /></td>
					</tr>
				</form>
			</div>
			<div class="cai">订单分类：</div>
			<div class="select_div">
				<select class="selectedd">
					<option>请选择</option>
					<option value="DingDanManagerShow" status="0">未制作订单</option>
					<option value="DingDanManagerShow" status="1">制作中订单</option>
					<option value="DingDanManagerShow" status="2">制作完成订单</option>
					<option value="DingDanManagerShow" status="3">已取消订单</option>
					<option value="DingDanManagerShow" status="4">交易完成订单</option>
					<option value="DingDanManagerShow" status="5">上菜完成订单</option>
				</select>
			</div>
		 <div class="cai">
		 	<a href="#">
			<input type="image" title="查看所有" src="../image/suoyou.png">
			</a>
		</div> 
			 
		</div>
		<table class="table1">
			<tr>
				<th>订单ID</th>
				<th>时间</th>
				<th>用户</th>
				<th>用户类型</th>
				<th>餐桌</th>
				<th>合计</th>
				<th class="thh">备注</th>
				<th>状态</th>
				<th style="width: 30%">操作</th>
			</tr>
			<c:forEach items="${map.dingdan}" var="x">
				<tr>
					<td>${x.dingdanId}</td>
					<td><fmt:formatDate value="${x.riqi }" pattern="yyyy-MM-dd HH:mm:ss"/> </td>
					<td><c:if test="${x.userId==999999}" var="zz">
						桌面点餐
						</c:if> <c:if test="${not zz}">
							${x.userId}
							</c:if></td>
					<td>${x.userType==0?"预约":"非预约"}</td>
					<td>${x.tableName}</td>
					<td>￥${x.heji}</td>
					<td>
						<div style='width: 100px; overflow: hidden; height: 20px;'
							onmouseover='this.style.width="200px"'
							onmouseout='this.style.width="100px"'>${x.remark}</div>
					</td>
					<td><c:if test="${x.status==0}">
							未制作
						</c:if> <c:if test="${x.status==1}">
							制作中
						</c:if> <c:if test="${x.status==2}">
							已完成制作
						</c:if> <c:if test="${x.status==3}">
							取消订单
						</c:if> <c:if test="${x.status==4}">
							交易完成
						</c:if> <c:if test="${x.status==5}">
							上菜完成
						</c:if></td>
					<td><a href="javascript:void(0)" class="xq"did="${x.dingdanId}" dst="${x.status}" title="详情"><img alt=""
							src="../image/xiangqing.png" width="20px" height="20px"></a> <c:if
							test="${x.status==5}" var="jiezhang">
							<a href="javascript:void(0)" class="jiezhang"
								did="${x.dingdanId}" statu="${x.status}" title="结账"><img
								alt="" src="../image/jiehang1.png" width="20px" height="20px"></a>
						</c:if> <c:if test="${not jiezhang}">
							<a title="结账"><img alt="" src="../image/jiehang1.png"
								width="20px" height="20px"></a>
						</c:if> <c:if test="${not empty applicationScope.info }">
							<c:choose>
								<c:when test="${applicationScope.info.zhiwei=='经理' }">
									<c:if
										test="${x.status==0||x.status==1||x.status==5||x.status==2}"
										var="shanchu">
										<img alt="" src="../image/delete_shanchu.png" title="删除订单"
											width="20px" height="20px">
									</c:if>
									<c:if test="${not shanchu}">
										<a href="javascript:void(0)" class="shanchu"
											statu="${x.status}" did="${x.dingdanId}" title="删除订单"><img
											alt="" src="../image/delete_shanchu.png" width="20px"
											height="20px"></a>
									</c:if>
								</c:when>
							</c:choose>
						</c:if> <c:if test="${x.status ==0}" var="quxiaodingdan">
							<a href="javascript:void(0)" class="quxiao" statu="${x.status}"
								did="${x.dingdanId}" title="取消订单"> <img alt=""
								src="../image/quxiao.png" width="20px" height="20px">
							</a>
						</c:if> <c:if test="${not quxiaodingdan}">
							<A><img alt="" src="../image/quxiao.png" title="取消订单"
								width="20px" height="20px"></A>
						</c:if></td>
				</tr>
			</c:forEach>
		</table>
<jsp:include   page="pagination.jsp" flush="true"/>
	</div>
	<!-- 弹出层  -->
	<div class="tanchu">
		<div class="title">
			<div class="guanbi" onclick="guanbi()">
				<img alt="关闭" src="../image/close.png" width="100%" height="100%">
			</div>
		</div>
		<iframe frameborder="0" name="iframe2" id="frame1"></iframe>
	</div>
<script type="text/javascript" src="../js/jquery-3.2.1.js"></script>
<script src="../js/layer/layer.js" type="text/javascript"></script>
<script type="text/javascript" src="../js/jquery.form.js"></script>
<script type="text/javascript" src="../js/dindan/DingDanManager.js"></script>
</body>
</html>